<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>portk</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="port.html" title="port" />
    <link rel="next" href="poscil3.html" title="poscil3" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">portk</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="port.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="poscil3.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="portk"></a>
      <div class="titlepage"></div>
      <a id="IndexPortk" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">portk</span>
        </h2>
        <p>portk — 
      Applies portamento to a step-valued control signal.
          </p>
      </div>
      <div class="refsect1">
        <a id="idp135110032"></a>
        <h2>Description</h2>
        <p>
      Applies portamento to a step-valued control signal.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135111392"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">kres <span class="command"><strong>portk</strong></span> ksig, khtim [, isig]</pre>
      </div>
      <div class="refsect1">
        <a id="idp135181616"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>isig</em></span> (optional, default=0) -- initial (i.e. previous) value for internal feedback. The default value is 0.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135183472"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>kres</em></span> -- the output signal at control-rate.
    </p>
        <p>
      <span class="emphasis"><em>ksig</em></span> -- the input signal at control-rate.
    </p>
        <p>
      <span class="emphasis"><em>khtim</em></span> -- half-time of the function in seconds.
    </p>
        <p>
      <span class="emphasis"><em>portk</em></span> is like <a class="link" href="port.html" title="port"><em class="citetitle">port</em></a> except the half-time can be varied at the control rate.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135188928"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the portk opcode. It uses the file <a class="ulink" href="examples/portk.csd" target="_top"><em class="citetitle">portk.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp135190704"></a>
          <p class="title">
            <strong>Example 640. Example of the portk opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in</span>
-odac         <span class="comment">;  -iadc    ;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o portk.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 128
<span class="ohdr">nchnls</span> <span class="op">=</span> 1

<span class="comment">;Example by Andres Cabrera 2007</span>

<span class="opc">FLpanel</span> "Slider", 650, 140, 50, 50
    gkval1, gislider1 <span class="opc">FLslider</span> "Watch me", 0, 127, 0, 5, <span class="op">-</span>1, 580, 30, 25, 20
    gkval2, gislider2 <span class="opc">FLslider</span> "Move me", 0, 127, 0, 5, <span class="op">-</span>1, 580, 30, 25, 80
    gkhtim, gislider3 <span class="opc">FLslider</span> "khtim", 0.1, 1, 0, 6, <span class="op">-</span>1, 30, 100, 610, 10
<span class="opc">FLpanelEnd</span>
<span class="opc">FLrun</span>

<span class="opc">FLsetVal_i</span> 0.1, gislider3 <span class="comment">;set initial time to 0.1</span>

<span class="oblock">instr</span> 1
kval <span class="opc">portk</span> gkval2, gkhtim  <span class="comment">; take the value of slider 2 and apply portamento</span>
<span class="opc">FLsetVal</span> 1, kval, gislider1  <span class="comment">;set the value of slider 1 to kval</span>
<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="comment">; Play Instrument #1 for one minute.</span>
<span class="stamnt">i</span> 1 0 60
<span class="stamnt">e</span>


<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135195024"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="areson.html" title="areson"><em class="citetitle">areson</em></a>,
      <a class="link" href="aresonk.html" title="aresonk"><em class="citetitle">aresonk</em></a>,
      <a class="link" href="atone.html" title="atone"><em class="citetitle">atone</em></a>,
      <a class="link" href="atonek.html" title="atonek"><em class="citetitle">atonek</em></a>,
      <a class="link" href="port.html" title="port"><em class="citetitle">port</em></a>,
      <a class="link" href="reson.html" title="reson"><em class="citetitle">reson</em></a>,
      <a class="link" href="resonk.html" title="resonk"><em class="citetitle">resonk</em></a>,
      <a class="link" href="tone.html" title="tone"><em class="citetitle">tone</em></a>,
      <a class="link" href="tonek.html" title="tonek"><em class="citetitle">tonek</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135204784"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Robin Whittle</td>
          </tr>
          <tr>
            <td>Australia</td>
          </tr>
          <tr>
            <td>May 1997</td>
          </tr>
        </table>
        <p>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="port.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="poscil3.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">port </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> poscil3</td>
        </tr>
      </table>
    </div>
  </body>
</html>
